f4a857
@@ -144,6 +144,10 @@
    */
   private boolean isUsingThriftJDBCBinarySerDe = false;
 
+  /**
+   * The flag to indicate if the session already started so we can skip the init
+   */
+  private boolean isStarted = false;
   /*
    * HiveHistory Object
    */
@@ -547,9 +551,14 @@
public static void endStart(SessionState startSs)
     startSs.tezSessionState.endOpen();
   }
 
-  private static void start(SessionState startSs, boolean isAsync, LogHelper console) {
+  synchronized private static void start(SessionState startSs, boolean isAsync, LogHelper console) {
     setCurrentSessionState(startSs);
 
+    if (startSs.isStarted) {
+      return;
+    }
+    startSs.isStarted = true;
+
     if (startSs.hiveHist == null){
       if (startSs.getConf().getBoolVar(HiveConf.ConfVars.HIVE_SESSION_HISTORY_ENABLED)) {
         startSs.hiveHist = new HiveHistoryImpl(startSs);
